home *** CD-ROM | disk | FTP | other *** search
-
-
-
- aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((3333ddddmmmm)))) aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((3333ddddmmmm))))
-
-
-
- NNNNAAAAMMMMEEEE
- alSetErrorHandler - establish an alternate audio error handling routine
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiioooo....hhhh>>>>
-
- AAAALLLLeeeerrrrrrrrffffuuuunnnncccc aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((AAAALLLLeeeerrrrrrrrffffuuuunnnncccc eeeeffffuuuunnnncccc))))
-
- PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
- _e_f_u_n_c expects a pointer to an error handling routine declared as
- vvvvooooiiiidddd eeeerrrrrrrroooorrrrffffuuuunnnncccc((((iiiinnnntttt,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr****,,,, ............))))
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- By default, the Audio Library handles errors silently, returning a
- failure code to the caller. aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((3333ddddmmmm)))) allows you to install
- an error handling routine which is called in the event of an error in an
- Audio Library call. This error handler can be a function in the
- application or a default error handler provided by the AL.
-
- Two special values are accepted for _e_f_u_n_c. If _e_f_u_n_c is 0, errors are
- handled silently and no error handler is called. This is the default
- behavior. If _e_f_u_n_c is AL_PRINT_ERRORS, the AL installs a simple internal
- error handler which prints a message to stderr. This was the default
- behavior in older versions of the AL. If _e_f_u_n_c is neither of these
- values, it is assumed to be a pointer to a function provided by the
- caller.
-
- The arguments that are passed to the error handling routine are an error
- code and a printf-like string perhaps followed with printf-like
- arguments.
-
- The returned value is a pointer to the previous value of _e_f_u_n_c.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEE
- #include <dmedia/audio.h>
-
- static void
- myerror(int code, const char* fmt, ...)
- {
- /* do something with code */
- }
-
- void example()
- {
- ALerrfunc originalErrorHandler;
- ...
-
- /* set up myerror as the error handler */
- originalErrorHandler = alSetErrorHandler(myerror);
-
- /* do some audio stuff here */
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((3333ddddmmmm)))) aaaallllSSSSeeeettttEEEErrrrrrrroooorrrrHHHHaaaannnnddddlllleeeerrrr((((3333ddddmmmm))))
-
-
-
- alSetErrorHandler(originalErrorHandler);
- /* back to normal behavior: errors are ignored */
-
- ...
- }
-
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- stdarg(5)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-